<template>
  <div class="paySuccess">
    <p>支付成功，请返回刷新账户列表</p>
    <p>*您的充值需要等待区块链上60个确认后会到账，若您充值超过24小时后仍未到账，请在您核对转账信息无误后联系客服</p>
    <p>等待{{time}}s，跳转回
      <span style="color: #1E0294;cursor: pointer" @click="returnAccount">账户余额</span>
      页面</p>
  </div>
</template>

<script>
  export default {
    name: "paySuccess",
    data() {
      return {
        time: 5,
        timer3: null
      }
    },
    mounted() {
      this.setTime(this.time)
    },
    methods: {
      setTime(num) {
        if (num <= 0) {
          this.$router.push('personCenter')
          return false
        } else {
          num--
        }
        this.time = num
        this.timer3 = setTimeout(() => {
          this.setTime(num)
        }, 1000)
      },
      returnAccount() {
        this.$router.push('personCenter')
      }
    },
    beforeDestroy() {
      clearTimeout(this.timer3)
    }
  }
</script>

<style scoped lang="scss">
  .paySuccess {
    min-height: 750px;

    p:nth-child(1) {
      padding: 100px 100px 10px;
      font-size: 28px
    }
    p:nth-child(2) {
      padding: 20px;
      font-size: 18px
    }
  }

  @media screen and (max-width: 800px) {
    .paySuccess {
      min-height: 650px;

      p:nth-child(1) {
        padding: 100px 10px 10px;
        font-size: 24px
      }
    }
  }

</style>
